cmake_minimum_required(VERSION 3.2.0)
project(temporary)

set(CMAKE_C_COMPILER "D:/dev/mingw/bin/gcc.exe")
set(CMAKE_CXX_COMPILER "D:/dev/mingw/bin/g++.exe")

find_package(Eigen3 3.1.0 REQUIRED)
find_package(OpenCV 4.4)

include_directories(
    include
    ${EIGEN3_INCLUDE_DIR}
    ${OpenCV_INCLUDE_DIRS})

file(GLOB SRCS "src/*.cpp")

foreach(src_file ${SRCS})
    get_filename_component(src_name ${src_file} NAME_WE ABSOLUTE)
    add_executable(${src_name} src/${src_name}.cpp)
    target_link_libraries(${src_name} ${OpenCV_LIBS})
endforeach()